package com.ruoyi.hr.common.utils;

import com.ruoyi.hr.common.constant.StatusConst;


/**
 * 状态解析类
 */
public class StatusParser {
	// 简历位置,简历状态,背调状态
	private Integer resumeStatus;

	private Integer positionStatus;

	private Integer bgStatus;



	public StatusParser(String strStatus) {
		String[] split = strStatus.split(",");
		if (split.length < 3){
			// TODO 状态码有问题, 后续抛出异常进行处理
		}
		positionStatus = Integer.valueOf(split[0]);
		resumeStatus = Integer.valueOf(split[1]);
		bgStatus = Integer.valueOf(split[2]);
	}


	/**
	 * 重新转换为逗号拼接的状态码的
	 * @return
	 */
	public String getStrStatus(){
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.append(positionStatus).append(",").append(resumeStatus).append(",").append(bgStatus);
		return stringBuilder.toString();
	}

	public void setResumeStatus(Integer resumeStatus) {
		this.resumeStatus = resumeStatus;
	}

	public void setPositionStatus(Integer positionStatus) {
		this.positionStatus = positionStatus;
	}

	public void setBgStatus(Integer bgStatus) {
		this.bgStatus = bgStatus;
	}

	public Integer getResumeStatusCode() {
		return resumeStatus;
	}

	public Integer getPositionStatusCode() {
		return positionStatus;
	}

	public Integer getBgStatusCode() {
		return bgStatus;
	}


	public String getResumeStatusName() {
		return StatusConst.Resume.ResumeStatus.getMsgByCode(resumeStatus);
	}

	public String getPositionStatusName() {
		return StatusConst.Resume.PositionStatus.getMsgByCode(positionStatus);
	}

	public String getBgStatusName() {
		return StatusConst.Resume.BGStatus.getMsgByCode(bgStatus);
	}
}
